<template>
  <div id="app">
    <img src="./assets/logo.png">
    <h1>{{ msg }}</h1>
    <span v-for="item in items">{{ item }},</span>
    <div v-on:click="show()">点击显示msg消息</div>
    <ul>
      <li v-for="objItem in objItems">{{ objItem.firstName }} {{ objItem.lastName }} 的年龄是 {{ objItem.age }}</li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'app',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      items:[11,20,13,14,18,16,17,15,19,12],
      objItems:[{
        firstName:'王',
        lastName:'义彬',
        age:35
      },{
        firstName:'张',
        lastName:'小红',
        age:18
      }]
    }
  },
  methods:{
    show:function(){
      alert(this.msg);
    }
  }
}
</script>

<style lang="scss">
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

h1, h2 {
  font-weight: normal;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}
</style>
